<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>开始任务页面</title>
    <!-- 引入 Font Awesome 图标库 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">

    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            height: 100vh;
        }

        /* 顶部状态栏样式 */
        #status-bar {
            background-color: #2c3e50;
            color: white;
            padding: 20px;
            text-align: center;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 20px;
        }

        #status-bar p {
            margin: 0;
            font-size: 14px;
            font-weight: 300;
            letter-spacing: 0.5px;
        }

        /* 中间按钮操作区域样式 */
        #action-area {
            flex: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: #f4f4f4;
        }

        #start-button {
            padding: 30px 60px; /* 增大按钮内边距以放大按钮 */
            font-size: 32px; /* 增大字体大小 */
            border: none;
            background-color: #007BFF;
            color: white;
            border-radius: 10px; /* 增大圆角半径 */
            cursor: pointer;
            transition: background-color 0.3s ease;
            width: 80%; /* 在小屏幕上占比更宽 */
            max-width: 400px; /* 最大宽度限制 */
        }

        #start-button:hover {
            background-color: #0056b3;
        }

        @media (max-width: 768px) {
            #start-button {
                width: 90%; /* 在小屏幕上占比更宽 */
            }
        }
        /* 悬浮按钮样式 */
        #back-to-home {
            position: fixed;
            top: 700px;
            right: 20px;
            background-color: #007BFF;
            color: white;
            padding: 10px 15px;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
            transition: background-color 0.3s ease;
        }

        #back-to-home:hover {
            background-color: #0056b3;
        }
    </style>

    <script>
        window.onload = function () {
            // 获取 URL 查询字符串
            const queryString = window.location.search;
            // 创建 URLSearchParams 对象
            const urlParams = new URLSearchParams(queryString);
            // 获取 taskId 参数
            const taskId = urlParams.get('taskId');
            if (taskId) {
                console.log('获取到的 taskId 参数为: ', taskId);
                // 你可以在这里添加使用 taskId 的逻辑，例如将其添加到按钮的跳转链接中
               document.getElementById("taskId").textContent = taskId;
            }
        };
    </script>
</head>

<body>
<div id="status-bar">
    <p>设备 ID: 123456</p>
    <p>设备名称: 示例设备</p>
    <p>设备电量: 80%</p>
    <p>运行状态: 就绪</p>
    <p>系统版本: 1.0.0</p>
</div>
<div>
    <p>任务 ID: <span id="taskId"></span></p>
</div>
<div id="action-area">
    <button id="start-button" onclick="window.location.href='/processing'">开始采集数据</button>
</div>

<!-- 悬浮按钮 -->
<button id="back-to-home" onclick="window.location.href='/task'">
    <i class="fa-solid fa-home"></i>
</button>
</body>

</html>
